package khmt.lvtn.dhbk.model.process;

import java.io.BufferedReader;
import java.io.FileReader;

public class ResultCompare {
	public void compareEachLine(String file1, String file2) {

		try {
			FileReader fr1 = new FileReader(file1);
			FileReader fr2 = new FileReader(file2);
			BufferedReader buf1 = new BufferedReader(fr1);
			BufferedReader buf2 = new BufferedReader(fr2);
			String line1 = null;
			String line2 = null;
			int same = 0;
			int notSame = 0;
			while (((line1 = buf1.readLine()) != null)
					&& ((line2 = buf2.readLine()) != null)) {
				if (line1.equals(line2)) {
					same++;
				} else {
					notSame++;
				}
			}
			buf1.close();
			buf2.close();
			System.out.println("Lines of Same: " + same);
			System.out.println("Lines of notSame: " + notSame);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
